home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / 0141ter2.zip / 0141TER2._XE / PASCAL.EXE / XLATE.PAS < prev   
Pascal/Delphi Source File  |  1993-09-23  |  1KB  |  46 lines

  1. { Small sample program to show how the translation files are build or if }
  2. { you want to make a converter from other programs                       }
  3.  
  4. Type
  5.  
  6.   TranslationType = Record
  7.                       TableNote : String[54];
  8.                       InTable,
  9.                       OutTable   : Array[0..255] of Char;
  10.                       Filler     : Array[1..33] of Char;
  11.                     End;
  12.  
  13. Var
  14.   T : TranslationType;
  15.   F : File of TranslationType;
  16.  
  17.   X : Byte;
  18.  
  19. Begin
  20.   WriteLn('Terminate translation viewer, by Bo Bendtsen 1993');
  21.   If Paramcount<>1 Then WriteLn('Syntax: XLATE filename.xlt')
  22.   Else Begin
  23.     Assign(F,ParamStr(1));
  24.     {$I-} Reset(F); {$I+}
  25.     If IOResult=0 Then
  26.     Begin
  27.       Read(F,T);
  28.       Close(F);
  29.       WriteLn;
  30.       WriteLn('Incoming translation:');
  31.       For X:=0 to 255 Do 
  32.         If x<>Ord(T.InTable[x]) Then 
  33.           WriteLn(x,' ',Ord(T.InTable[x]),' ('+T.InTable[x]+')');
  34.       WriteLn; 
  35.       WriteLn('Outgoing translation:');
  36.       For X:=0 to 255 Do 
  37.         If x<>Ord(T.OutTable[x]) Then 
  38.           WriteLn(x,' ',Ord(T.OutTable[x]),' ('+T.OutTable[x]+')');
  39.       WriteLn(#10'Table: '+T.TableNote);
  40.     End
  41.     Else 
  42.       WriteLn('Could not open file');
  43.   End
  44. End.
  45.  
  46.